#include<iostream>
#include<vector>
using namespace std;
string suan(string s);
int main(){
	string s,s1="";
	vector<string>ss;
	cin>>s;
	for(int i=0;i<s.size();++i){
		if(s[i]=='+'){
			s1=suan(s1);
			ss.push_back(s1);
			s1="";
			continue;
		}
		s1+=s[i];
	}
	s1=suan(s1);
	ss.push_back(s1);
	int xx=0,a;
	for(int i=0;i<ss.size();++i){
		sscanf(ss[i].c_str(),"%d",&a);
		xx+=a;
		xx=xx%10+xx/10%10*10+xx/100%10*100+xx/1000%10*1000;
	}
	cout<<xx;
	return 0;
}
string suan(string s){
	vector<int>a;
	for(int i=0;i<s.length();++i){
		if(s[i]=='*'){
			a.push_back(i);
		}
	}
	string s1="";
	vector<string>ss;
	if(!a.empty()){
		a.push_back(s.size());
		for(int i=0;i<a.size();++i){
			if(i==0){
				if(a[i]>4){
					for(int j=a[i]-4;j<a[i];++j){
						s1+=s[j];
					}
				}
				else{
					for(int j=0;j<a[i];++j){
						s1+=s[j];
					}
				}
			}
			else{
				if(a[i]-a[i-1]>4){
					for(int j=a[i]-4;j<a[i];++j){
						s1+=s[j];
					}
				}
				else{
					for(int j=a[i-1]+1;j<a[i];++j){
						s1+=s[j];
					}
				}
			}
			ss.push_back(s1);
			s1="";
		}
		int n=ss.size();
		int b,xx=1;
		for(int i=0;i<n;++i){
			sscanf(ss[i].c_str(),"%d",&b);
			xx*=b;
			xx=xx%10+xx/10%10*10+xx/100%10*100+xx/1000%10*1000;
		}
		char c[4];
		sprintf(c,"%d",xx);
		s1=c;
		return s1;
	}
	if(s.size()>4){
		for(int i=s.size()-4;i<s.size();++i){
			s1+=s[i];
		}
		return s1;
	}
	return s;
}